import request from '../../utils/request';
import config from '../../utils/config';

const { api } = config;
const { task: {
  statisticsEmpDay,
  statisticsEmpMonth,
} } = api;

type StatisticsEmpDayInput = {
}
type StatisticsEmpDayOutput = {
  code: number,
  note: string,
  record: {
		type: string,	//类型1|全部；2|重要；3|非常重要
		total: string,	//总数
		done: string,	//完成数
	}
};
// 员工今日任务统计
export async function StatisticsEmpDay(payload: StatisticsEmpDayInput): Promise<StatisticsEmpDayOutput> {
  const option = {
    url: statisticsEmpDay, // v1.task.statistics.empDay
    method: 'GET',
    data: payload,
  };
  return request(option);
}

type StatisticsEmpMonthInput = {
}
type StatisticsEmpMonthOutput = {
  code: number,
  note: string,
  record: {
		type: string,	//类型1|全部；2|重要；3|非常重要
		total: string,	//总数
		done: string,	//完成数
	}
};
// 员工本月任务统计
export async function StatisticsEmpMonth(payload: StatisticsEmpMonthInput): Promise<StatisticsEmpMonthOutput> {
  const option = {
    url: statisticsEmpMonth, // v1.task.statistics.empMonth
    method: 'GET',
    data: payload,
  };
  return request(option);
}
